﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NHibernateDown2Earth.Core.Entities
{
	public class Order
	{
		public virtual long Id { get; private set; }
		public virtual DateTime Date { get; set; }

		public virtual decimal Cost()
		{
			decimal total = 0.0m;
			foreach (var item in Items)
			{
				//total += item.Qty * item.UnitCost;
				total = total + (item.Qty * item.UnitCost);
			}
			return total;
		}

		public virtual IList<OrderDetail> Items { get; set; }
	}
}
